

var ulbox=document.querySelector("main ul");

let xhr1=new XMLHttpRequest();
xhr1.open("get",`http://chst.vip:1234/api/getsitenav`,false)
xhr1.onload=function(){
   var lis='';
  if(xhr1.status===200){
  let res1=JSON.parse(xhr1.responseText);
                  console.log(res1.result);
                  res1.result.forEach(v => {
                    lis+=`
                    <li>
                    <a href="${v.navHref}">
                                        <img src="${v.navImg}" alt="">
                                        <span>${v.navTitle}</span>
                    </a>
                    </li>
                  `
                  });
                  

}
ulbox.innerHTML=lis;
}
xhr1.send();